package com.company.bookstore.common.result;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
public class MvcResult <T> {
    public static final MvcResult<Object> LOGING_ERROR = MvcResult.builder().code(403).message("登录失败").build();
    public static final MvcResult<Object> LOGING_SUCCESS = MvcResult.builder().code(200).message("登录成功").build();
    public static final MvcResult<Object> REGISTER_SUCCESS = MvcResult.builder().code(200).message("注册成功").build();
    public static final MvcResult<Object> REGISTER_FAIL = MvcResult.builder().code(403).message("注册失败").build();
    public static final MvcResult<Object> DELETE_USER_SUCCESS = MvcResult.builder().code(200).message("成功删除用户").build();
    public static final MvcResult<Object> DELETE_USER_FAIL = MvcResult.builder().code(500).message("删除用户失败").build();
    public static final MvcResult<Object> FIX_USER_SUCCESS = MvcResult.builder().code(200).message("成功修改用户").build();
    public static final MvcResult<Object> FIX_USER_FAIL = MvcResult.builder().code(500).message("修改用户失败").build();
    public static final MvcResult<Object> FIX_ADMIN_SUCCESS = MvcResult.builder().code(200).message("成功修改管理员").build();
    public static final MvcResult<Object> FIX_ADMIN_FAIL = MvcResult.builder().code(500).message("修改管理员失败").build();
    public static final MvcResult<Object> NO_TOKEN = MvcResult.builder().code(403).message("没有权限调用接口").build();

    public static final MvcResult<Object> ERR_TOKEN = MvcResult.builder().code(500).message("token解析异常").build();

    public static final MvcResult<Object> SELECT_SUCCESS = MvcResult.builder().code(200).message("查询成功").build();
    public static final MvcResult<Object> SELECT_FAIL = MvcResult.builder().code(500).message("对不起，暂未找到您搜索的内容！").build();
    public static final MvcResult<Object> UPDATE_SUCCESS = MvcResult.builder().code(200).message("修改成功").build();
    public static final MvcResult<Object> UPDATE_FAIL = MvcResult.builder().code(500).message("修改失败").build();
    public static final MvcResult<Object> ADD_SUCCESS = MvcResult.builder().code(200).message("添加成功").build();
    public static final MvcResult<Object> ADD_FAIL = MvcResult.builder().code(500).message("操作失败，输入信息格式错误").build();
    public static final MvcResult<Object> DELETE_SUCCESS = MvcResult.builder().code(200).message("删除成功").build();
    public static final MvcResult<Object> DELETE_FAIL = MvcResult.builder().code(200).message("删除失败").build();
    public static final MvcResult<Object> DuplicateException = MvcResult.builder().code(500).message("添加失败，数据已存在").build();
    public static final MvcResult<Object> INTERFACE_LIMIT = MvcResult.builder().code(505).message("系统繁忙，请稍后再试").build();

    private String message;
    private int code;
    private T object;
}

